// Learn TypeScript:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html

const {ccclass, property} = cc._decorator;

@ccclass
export default class SoundCtrl extends cc.Component {

    @property(cc.Node)
    soundBtnOn: cc.Node = null;
    @property(cc.Node)
    soundBtnOff: cc.Node = null;

    @property(cc.Node)
    musicBtnOn: cc.Node = null;
    @property(cc.Node)
    musicBtnOff: cc.Node = null;

    

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {}

    onSoundBtnClick(event,data)
    {
        if(this.soundBtnOn.active)
        {
            
            this.soundBtnOn.active = false;
            this.soundBtnOff.active = true;
        }
        else
        {
            
            this.soundBtnOn.active = true;
            this.soundBtnOff.active = false;
        }
    }

    onMusicBtnClick(event,data)
    {
        if(this.musicBtnOn.active)
        {
            
            this.musicBtnOn.active = false;
            this.musicBtnOff.active = true;
        }
        else
        {
            
            this.musicBtnOn.active = true;
            this.musicBtnOff.active = false;
        }
    }
    start () {

    }

    // update (dt) {}
}
